import request from '@/utils/request'

// 资金管理数据统计
export function dataStats(query) {
  return request({
    url: '/system/order/stats',
    method: 'get',
    loading: true,
    params: query
  })
}

// 订单列表
export function pageList(query) {
  return request({
    url: '/system/order/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 订单列表
export function orderDetail(orderId) {
  return request({
    url: '/system/order/' + orderId,
    method: 'get',
    loading: true
  })
}

// 获取某个活动带来的订单列表
export function bringOrderDataList(query) {
  return request({
    url: '/system/order/bringOrder/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 订单核销
export function orderVerification(data) {
  return request({
    url: '/system/order/verification',
    method: 'post',
    data: data
  })
}

// 订单退款
export function refund(orderId) {
  return request({
    url: '/system/order/refund/' + orderId,
    method: 'post',
    loading: true
  })
}

// 升为团长
export function upgrade(orderId) {
  return request({
    url: '/system/order/upgrade/' + orderId,
    method: 'post',
    loading: true
  })
}

// 降为团员
export function reduce(orderId) {
  return request({
    url: '/system/order/reduce/' + orderId,
    method: 'post',
    loading: true
  })
}

// 独立成团
export function isolate(orderId) {
  return request({
    url: '/system/order/isolate/' + orderId,
    method: 'post',
    loading: true
  })
}

// 批量退款
export function batchRefund(ids) {
  return request({
    url: '/system/order/batchRefund/' + ids,
    method: 'post',
    loading: true
  })
}

// 用户分销订单列表
export function distributionOrderList(query) {
  return request({
    url: '/system/order/distributionOrder/pageList',
    method: 'get',
    params: query,
    loading: true
  })
}

// 移团
export function moveToTeam(groupPurchaseId,orderId) {
  return request({
    url: '/system/order/moveToTeam/' + groupPurchaseId + '/' + orderId,
    method: 'post',
    loadIng: true
  })
}

// 修改报名信息
export function editEnroll(data) {
  return request({
    url: '/system/order/editEnroll',
    method: 'post',
    data: data
  })
}

//调整虚拟成员数量
export function confirmVirtual(orderId,data) {
  return request({
    url: '/system/order/virtual/' + orderId,
    method: 'post',
    loadIng: true,
    data: data
  })
}

//批量调整虚拟成员数量
export function batchConfirmVirtual(data) {
  return request({
    url: '/system/order/batchVirtual',
    method: 'post',
    loadIng: true,
    data: data
  })
}
